package itdep.services.address;

import ga.domain.repository.EntityCriteria;
import ga.domain.repository.GenericEntityFilterProcessor;
import itdep.domain.address.Region;

/**
 * @author Ivan Khalopik
 * @version $Revision: 47 $ $Date: 2010-07-05 09:28:44 +0000 (Mon, 05 Jul 2010) $
 */
public class RegionFilterProcessor extends GenericEntityFilterProcessor<Region, RegionFilter> {

	public RegionFilterProcessor() {
		super(Region.class);
	}

	@Override
	protected void processFilter(EntityCriteria criteria, RegionFilter filter) {
		if (filter.getCountry() != null) {
			criteria.add(criteria.getProperty(Region.COUNTRY_PROPERTY).eq(filter.getCountry()));
		}
	}
}
